package com.sjb.sixteen_journey_backend.controller;


import com.sjb.sixteen_journey_backend.common.R;
import com.sjb.sixteen_journey_backend.entity.MapSite;
import com.sjb.sixteen_journey_backend.entity.dto.MapSiteDto;
import com.sjb.sixteen_journey_backend.service.IMapSiteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 *  地图标记点表
 *
 * @author jcz
 * @since 2024-07-25
 */
@RestController
@RequestMapping("/map-site")
public class MapSiteController {

    @Autowired
    private IMapSiteService mapSiteService;

    /**
     * 添加地图标记点
     * @param mapSiteDto
     * @return
     */
    @PostMapping("/addSite")
    public R<List<MapSite>> addSite(@RequestBody MapSiteDto mapSiteDto){
        return mapSiteService.addSite(mapSiteDto);
    }

    /**
     * 取消收藏地图标记点
     * @param id
     * @return
     */
    @DeleteMapping("/removeCollected/{id}")
    public R<List<MapSite>> removeCollected(@PathVariable("id") Integer id){
        return mapSiteService.removeCollected(id);
    }

}
